package SSF.OS.WWW;

/**
 * httpResponse.java
 * Created: Wed Nov 24 1999 ato
 * @version 0.1
 */
public class httpResponse {

  /************************ Variables ***************************/


  /** type of this response */
  public byte responseType;

  /** number of inlined objects in page - in response to PAGE request */
  public int numObjects;

  /** object size (in bytes) - in response to PAGE, OBJECT request */
  public int objSize;

  /************************* Constructors ************************/

  public httpResponse() {}

  public httpResponse(byte response_type, int num_obj, int obj_size) {
    responseType = response_type;
    numObjects = num_obj;
    objSize = obj_size;
  }
  
  /************************ Class Methods ***********************/

  /** to print the response message*/
  @Override
public String toString() {
    String str = " ";
    if((responseType & httpRequest.PAGE) == httpRequest.PAGE)
      str = str + "PAGE #objects = " + numObjects + " size = " + objSize + " ";
    if((responseType & httpRequest.OBJECT) == httpRequest.OBJECT)
      str = str + "OBJECT size = " + objSize + " ";
    if((responseType & httpRequest.CLOSE) == httpRequest.CLOSE)
      str = str + "CLOSE ";
    if(str != " ")
      return " [httpResponse:" + str + "]";
    else
      return " [httpResponse: UNKNOWN RESPONSE]";
  }
}
